package com.zhongfeng.api.modules.white;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.*;

public class ShuffleNumber {
    public static void main(String[] args) throws IOException {
        //存储结果集
        List<String> numberList = new ArrayList<>();

//        String filePacket  = "120.233.31.138";
//        String prefix = "B1";

//        String filePacket = "120.232.132.24";
//        String prefix = "A4";

//        String filePacket = "120.233.31.139";
//        String prefix = "A3";

//        String filePacket = "120.232.252.30";
//        String prefix = "A2";

//        String filePacket = "120.232.132.5";
//        String prefix = "A1";

//        String filePacket = "120.232.252.29";
//        String prefix = "A5";

//        String file = "C:\\Users\\84361\\Desktop\\工作文档\\号码集合\\";
        String prefix = "139";
        String file = "C:\\Users\\84361\\Desktop\\A号码蓝本";
        String filename = file+"\\"+prefix+".txt";
        Scanner sc = new Scanner(new FileReader(filename));
        while (sc.hasNextLine()) {
            numberList.add(sc.nextLine());
        }
        //得到的文件份数
        int count = 1;
        FileWriter fw = new FileWriter(file+"\\"+prefix+"-1.txt");
        for (int i = 0; i < count; i++) {
            Collections.shuffle(numberList);
            fw = new FileWriter(file+"\\"+prefix+"-" + (i + 1) + ".txt");
            for (int i1 = 0; i1 < numberList.size(); i1++) {
                fw.write(numberList.get(i1)+"\n");
            }
            fw.flush();
        }
        fw.close();
    }
}
